home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1988 / Jun 88 / TDeskScrapView Bug 5⁄9 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.3 KB  |  34 lines  |  [TEXT/GEOL]

  1. Item    7606123                         9-May-88        17:46
  2.  
  3. From:   D0830                           Avalon Group, Dev, Rudulph Burger
  4.  
  5. To:     MACDTS                          Macintosh Developer Technical Supt.
  6.  
  7. cc:     MACAPP$                         MacApp Interest List
  8.  
  9. Sub:    TDeskScrapView Bug Fix
  10.  
  11. In case it hasn't already been reported, I thought I'd let you know of a bug I
  12. found in the MacApp v1.1.1 TDeskScrapView.AboutToDraw method which prevents the
  13. standard desk scrap view from handling some large scraps.
  14.  
  15. The local procedure LookForScrapType calls GetScrap, assigning the returned
  16. scrap length to a variable of type OSErr.  That number is then checked for
  17. validity, with values less than zero indicating an error condition.
  18. Unfortunately, GetScrap returns a LONGINT, and OSErr is an INTEGER.  The high
  19. order word of the LONGINT is lost during the assignment; thus scrap lengths of
  20. 32K or greater may incorrectly be converted to a negative number, producing an
  21. error.
  22.  
  23. The fix is simple; in MacApp.inc3.p, find:
  24.     PROCEDURE TDeskScrapView.AboutToDraw; OVERRIDE;
  25.         ...
  26.         PROCEDURE LookForScrapType(theResType: ResType): BOOLEAN;
  27.         VAR
  28.             err:    OSErr;
  29.                     ^^^^^
  30.  
  31. And change the incorrect line to:
  32.             err:    LONGINT;
  33.  
  34.